function HelpAssistant() {
	/* this is the creator function for your scene assistant object. It will be passed all the 
	   additional parameters (after the scene name) that were passed to pushScene. The reference
	   to the scene controller (this.controller) has not be established yet, so any initialization
	   that needs the scene controller should be done in the setup function below. */
}

HelpAssistant.prototype.setup = function() {
	try{
		// Setup Application Menu
		this.appMenuAttr = {omitDefaultItems: true};
		this.appMenuModel = {
			visible: true,
			items: [
				Mojo.Menu.editItem,
				{label: "Preferences", command: 'prefs-cmd'},
				{label: "About", command: 'about-cmd'}
		]};
		this.controller.setupWidget(Mojo.Menu.appMenu, this.appMenuAttr, this.appMenuModel);
		
		$('appTitle').innerHTML = Mojo.Controller.appInfo.title;
		$('appVersion').innerHTML = 'version ' + Mojo.Controller.appInfo.version;
		$('appImage').innerHTML = '<img src="' + Mojo.Controller.appInfo.icon + '" />';
		
		// AdMob request function
		void($('admobInfoSpawn').innerHTML=null);
		AdMob.ad.request({
			onSuccess: (function (ad) { // successful ad call, parameter 'ad' is the html markup for the ad
					this.controller.get('admobInfoSpawn').insert(ad); // place mark up in the the previously declared div
			}).bind(this),
			onFailure: (function () { // no ad was returned or call was unsuccessful
					void($('admobInfoSpawn').innerHTML="<div style=\"padding-left:10px; font-size:18px\"><span><strong>Unable to fetch AdMob ad.</strong><br />Consider donating...&nbsp;<a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_donations&amp;business=thegodfaza%40gmail%2ecom&amp;lc=US&amp;item_name=SageTV%20Remote&amp;currency_code=USD&amp;bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted\" rel=\"nofollow\"><img alt=\"\" src=\"images/btn_donate_SM.gif\" /></a></div>");
			}).bind(this),
		});
		
		// Donation EMail Button
		this.controller.setupWidget("donateEMail_button",
			this.attributes = {
				},
			this.model = {
				label : "Send yourself a donation link",
				disabled: false
			});
		Mojo.Event.listen(this.controller.get('donateEMail_button'), Mojo.Event.tap, this.donateEmailButton.bind(this));

		// Drawers
		//// Setup Drawer
		this.controller.setupWidget("setupDrawer",
			{property:'myOpenProperty'},
			{myOpenProperty:false}
		);
		Mojo.Event.listen(this.controller.get('setupDiv'), Mojo.Event.tap, this.toggleSetupDrawer.bind(this));
		//// SSL Drawer
		this.controller.setupWidget("sslDrawer",
			{property:'myOpenProperty'},
			{myOpenProperty:false}
		);
		Mojo.Event.listen(this.controller.get('sslDiv'), Mojo.Event.tap, this.toggleSSLDrawer.bind(this));
		//// Default Drawer
		this.controller.setupWidget("adInfoDrawer",
			{property:'myOpenProperty'},
			{myOpenProperty:false}
		);
		Mojo.Event.listen(this.controller.get('adInfoDiv'), Mojo.Event.tap, this.toggleAdInfoDrawer.bind(this));
/*		//// Welcome Drawer
		this.controller.setupWidget("welcomeDrawer",
			{property:'myOpenProperty'},
			{myOpenProperty:true}
		);
		Mojo.Event.listen(this.controller.get('welcomeDiv'), Mojo.Event.tap, this.toggleWelcomeDrawer.bind(this));
		//// Default Drawer
		this.controller.setupWidget("defaultDrawer",
			{property:'myOpenProperty'},
			{myOpenProperty:false}
		);
		Mojo.Event.listen(this.controller.get('defaultDiv'), Mojo.Event.tap, this.toggleDefaultDrawer.bind(this));
*/
	}catch (err) {
		this.showDialogBox('error', err);
	}
}

// Drawers
//// Setup
HelpAssistant.prototype.toggleSetupDrawer = function() {
	this.Drawer = this.controller.get('setupDrawer');
	this.Drawer.mojo.setOpenState(!this.Drawer.mojo.getOpenState());
	this.Div = this.controller.get('setupButton');
	if(this.Div.hasClassName('palm-arrow-expanded')) {
		this.Div.addClassName('palm-arrow-closed');
		this.Div.removeClassName('palm-arrow-expanded');
	} else if(this.Div.hasClassName('palm-arrow-closed')) {
		this.Div.addClassName('palm-arrow-expanded');
		this.Div.removeClassName('palm-arrow-closed');
	}
}
//// SSL
HelpAssistant.prototype.toggleSSLDrawer = function() {
	this.Drawer = this.controller.get('sslDrawer');
	this.Drawer.mojo.setOpenState(!this.Drawer.mojo.getOpenState());
	this.Div = this.controller.get('sslButton');
	if(this.Div.hasClassName('palm-arrow-expanded')) {
		this.Div.addClassName('palm-arrow-closed');
		this.Div.removeClassName('palm-arrow-expanded');
	} else if(this.Div.hasClassName('palm-arrow-closed')) {
		this.Div.addClassName('palm-arrow-expanded');
		this.Div.removeClassName('palm-arrow-closed');
	}
}
//// Ads and Donations
HelpAssistant.prototype.toggleAdInfoDrawer = function() {
	this.Drawer = this.controller.get('adInfoDrawer');
	this.Drawer.mojo.setOpenState(!this.Drawer.mojo.getOpenState());
	this.Div = this.controller.get('adInfoButton');
	if(this.Div.hasClassName('palm-arrow-expanded')) {
		this.Div.addClassName('palm-arrow-closed');
		this.Div.removeClassName('palm-arrow-expanded');
	} else if(this.Div.hasClassName('palm-arrow-closed')) {
		this.Div.addClassName('palm-arrow-expanded');
		this.Div.removeClassName('palm-arrow-closed');
	}
}
//// Welcome
HelpAssistant.prototype.toggleWelcomeDrawer = function() {
	this.Drawer = this.controller.get('welcomeDrawer');
	this.Drawer.mojo.setOpenState(!this.Drawer.mojo.getOpenState());
	this.Div = this.controller.get('welcomeButton');
	if(this.Div.hasClassName('palm-arrow-expanded')) {
		this.Div.addClassName('palm-arrow-closed');
		this.Div.removeClassName('palm-arrow-expanded');
	} else if(this.Div.hasClassName('palm-arrow-closed')) {
		this.Div.addClassName('palm-arrow-expanded');
		this.Div.removeClassName('palm-arrow-closed');
	}
}
//// Default
HelpAssistant.prototype.toggleDefaultDrawer = function() {
	this.Drawer = this.controller.get('defaultDrawer');
	this.Drawer.mojo.setOpenState(!this.Drawer.mojo.getOpenState());
	this.Div = this.controller.get('defaultButton');
	if(this.Div.hasClassName('palm-arrow-expanded')) {
		this.Div.addClassName('palm-arrow-closed');
		this.Div.removeClassName('palm-arrow-expanded');
	} else if(this.Div.hasClassName('palm-arrow-closed')) {
		this.Div.addClassName('palm-arrow-expanded');
		this.Div.removeClassName('palm-arrow-closed');
	}
}

HelpAssistant.prototype.donateEmailButton = function(event) {
	this.controller.serviceRequest('palm://com.palm.applicationManager', {
		method: 'launch',
		parameters:  {
			id: 'com.palm.app.email',
			params: {
				summary: 'Donation Link for SageTV Remote webOS Application',
				text: "<a href='https://www.paypal.com/cgi-bin/webscr?cmd=_donations&amp;business=thegodfaza%40gmail%2ecom&amp;lc=US&amp;item_name=SageTV%20Remote&amp;currency_code=USD&amp;bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted'>https://www.paypal.com/cgi-bin/webscr?cmd=_donations&amp;business=thegodfaza%40gmail%2ecom&amp;lc=US&amp;item_name=SageTV%20Remote&amp;currency_code=USD&amp;bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted</a>"
			}
		}
	});
}

HelpAssistant.prototype.showDialogBox = function (title, message) {
	this.controller.showAlertDialog({
		onChoose: function (value) {},
		title: title,
		message: message,
		allowHTMLMessage: true,
		choices: [ {label: 'OK', value: 'OK', type: 'color'} ]
	});
};

HelpAssistant.prototype.activate = function(event) {
	/* put in event handlers here that should only be in effect when this scene is active. For
	   example, key handlers that are observing the document */
	// CSS rules
	$$('body')[0].addClassName('help');
	$$('body')[0].addClassName('palm-dark');
	$$('body')[0].removeClassName('palm-default');
}


HelpAssistant.prototype.deactivate = function(event) {
	/* remove any event handlers you added in activate and do any other cleanup that should happen before
	   this scene is popped or another scene is pushed on top */
	$$('body')[0].addClassName('palm-default');
	$$('body')[0].removeClassName('help');
	$$('body')[0].removeClassName('palm-dark');
}

HelpAssistant.prototype.cleanup = function(event) {
}